import 'package:cbec_app/generated/json/base/json_convert_content.dart';
import 'package:cbec_app/entity/home/content/superior_special_price_entity.dart';

SuperiorSpecialPriceEntity $SuperiorSpecialPriceEntityFromJson(Map<String, dynamic> json) {
  final SuperiorSpecialPriceEntity superiorSpecialPriceEntity = SuperiorSpecialPriceEntity();
  final String? countdownTextColor = jsonConvert.convert<String>(json['countdown_text_color']);
  if (countdownTextColor != null) {
    superiorSpecialPriceEntity.countdownTextColor = countdownTextColor;
  }
  final int? moreBtnStyle = jsonConvert.convert<int>(json['more_btn_style']);
  if (moreBtnStyle != null) {
    superiorSpecialPriceEntity.moreBtnStyle = moreBtnStyle;
  }
  final int? pageMarginTop = jsonConvert.convert<int>(json['page_margin_top']);
  if (pageMarginTop != null) {
    superiorSpecialPriceEntity.pageMarginTop = pageMarginTop;
  }
  final String? displayScale = jsonConvert.convert<String>(json['display_scale']);
  if (displayScale != null) {
    superiorSpecialPriceEntity.displayScale = displayScale;
  }
  final String? imageFillStyle = jsonConvert.convert<String>(json['image_fill_style']);
  if (imageFillStyle != null) {
    superiorSpecialPriceEntity.imageFillStyle = imageFillStyle;
  }
  final String? maskColor = jsonConvert.convert<String>(json['mask_color']);
  if (maskColor != null) {
    superiorSpecialPriceEntity.maskColor = maskColor;
  }
  final int? countdownMarginLeft = jsonConvert.convert<int>(json['countdown_margin_left']);
  if (countdownMarginLeft != null) {
    superiorSpecialPriceEntity.countdownMarginLeft = countdownMarginLeft;
  }
  final String? cornerMarkType = jsonConvert.convert<String>(json['corner_mark_type']);
  if (cornerMarkType != null) {
    superiorSpecialPriceEntity.cornerMarkType = cornerMarkType;
  }
  final String? textAlignType = jsonConvert.convert<String>(json['text_align_type']);
  if (textAlignType != null) {
    superiorSpecialPriceEntity.textAlignType = textAlignType;
  }
  final bool? showCornerMark = jsonConvert.convert<bool>(json['show_corner_mark']);
  if (showCornerMark != null) {
    superiorSpecialPriceEntity.showCornerMark = showCornerMark;
  }
  final SuperiorSpecialPriceBgImage? bgImage = jsonConvert.convert<SuperiorSpecialPriceBgImage>(json['bg_image']);
  if (bgImage != null) {
    superiorSpecialPriceEntity.bgImage = bgImage;
  }
  final String? uuid = jsonConvert.convert<String>(json['uuid']);
  if (uuid != null) {
    superiorSpecialPriceEntity.uuid = uuid;
  }
  final int? pageMarginBottom2 = jsonConvert.convert<int>(json['page_margin_bottom_2']);
  if (pageMarginBottom2 != null) {
    superiorSpecialPriceEntity.pageMarginBottom2 = pageMarginBottom2;
  }
  final String? activityNameColor = jsonConvert.convert<String>(json['activity_name_color']);
  if (activityNameColor != null) {
    superiorSpecialPriceEntity.activityNameColor = activityNameColor;
  }
  final String? textStyleType = jsonConvert.convert<String>(json['text_style_type']);
  if (textStyleType != null) {
    superiorSpecialPriceEntity.textStyleType = textStyleType;
  }
  final String? price = jsonConvert.convert<String>(json['price']);
  if (price != null) {
    superiorSpecialPriceEntity.price = price;
  }
  final String? moreBtnColor = jsonConvert.convert<String>(json['more_btn_color']);
  if (moreBtnColor != null) {
    superiorSpecialPriceEntity.moreBtnColor = moreBtnColor;
  }
  final int? pageMarginRight = jsonConvert.convert<int>(json['page_margin_right']);
  if (pageMarginRight != null) {
    superiorSpecialPriceEntity.pageMarginRight = pageMarginRight;
  }
  final List<SuperiorSpecialPriceSubEntry>? subEntry = (json['sub_entry'] as List<dynamic>?)?.map((e) => jsonConvert.convert<SuperiorSpecialPriceSubEntry>(e) as SuperiorSpecialPriceSubEntry).toList();
  if (subEntry != null) {
    superiorSpecialPriceEntity.subEntry = subEntry;
  }
  final int? goodsMarginLeft2 = jsonConvert.convert<int>(json['goods_margin_left_2']);
  if (goodsMarginLeft2 != null) {
    superiorSpecialPriceEntity.goodsMarginLeft2 = goodsMarginLeft2;
  }
  final int? per = jsonConvert.convert<int>(json['per']);
  if (per != null) {
    superiorSpecialPriceEntity.per = per;
  }
  final bool? bottomrds = jsonConvert.convert<bool>(json['bottomrds']);
  if (bottomrds != null) {
    superiorSpecialPriceEntity.bottomrds = bottomrds;
  }
  final int? goodsMarginIner = jsonConvert.convert<int>(json['goods_margin_iner']);
  if (goodsMarginIner != null) {
    superiorSpecialPriceEntity.goodsMarginIner = goodsMarginIner;
  }
  final int? pageMarginBottom = jsonConvert.convert<int>(json['page_margin_bottom']);
  if (pageMarginBottom != null) {
    superiorSpecialPriceEntity.pageMarginBottom = pageMarginBottom;
  }
  final String? countdownBgColor = jsonConvert.convert<String>(json['countdown_bg_color']);
  if (countdownBgColor != null) {
    superiorSpecialPriceEntity.countdownBgColor = countdownBgColor;
  }
  final int? countdownMarginTop = jsonConvert.convert<int>(json['countdown_margin_top']);
  if (countdownMarginTop != null) {
    superiorSpecialPriceEntity.countdownMarginTop = countdownMarginTop;
  }
  final String? sizeType = jsonConvert.convert<String>(json['size_type']);
  if (sizeType != null) {
    superiorSpecialPriceEntity.sizeType = sizeType;
  }
  final int? pageMarginTop2 = jsonConvert.convert<int>(json['page_margin_top_2']);
  if (pageMarginTop2 != null) {
    superiorSpecialPriceEntity.pageMarginTop2 = pageMarginTop2;
  }
  final String? showCountDown = jsonConvert.convert<String>(json['show_count_down']);
  if (showCountDown != null) {
    superiorSpecialPriceEntity.showCountDown = showCountDown;
  }
  final String? titleColor = jsonConvert.convert<String>(json['title_color']);
  if (titleColor != null) {
    superiorSpecialPriceEntity.titleColor = titleColor;
  }
  final String? moreBtnText = jsonConvert.convert<String>(json['more_btn_text']);
  if (moreBtnText != null) {
    superiorSpecialPriceEntity.moreBtnText = moreBtnText;
  }
  final String? automatic = jsonConvert.convert<String>(json['automatic']);
  if (automatic != null) {
    superiorSpecialPriceEntity.automatic = automatic;
  }
  final int? countdownMarginBottom = jsonConvert.convert<int>(json['countdown_margin_bottom']);
  if (countdownMarginBottom != null) {
    superiorSpecialPriceEntity.countdownMarginBottom = countdownMarginBottom;
  }
  final String? priceColor = jsonConvert.convert<String>(json['price_color']);
  if (priceColor != null) {
    superiorSpecialPriceEntity.priceColor = priceColor;
  }
  final String? borderRadiusType = jsonConvert.convert<String>(json['border_radius_type']);
  if (borderRadiusType != null) {
    superiorSpecialPriceEntity.borderRadiusType = borderRadiusType;
  }
  final int? goodsMargin = jsonConvert.convert<int>(json['goods_margin']);
  if (goodsMargin != null) {
    superiorSpecialPriceEntity.goodsMargin = goodsMargin;
  }
  final int? pageMarginLeft = jsonConvert.convert<int>(json['page_margin_left']);
  if (pageMarginLeft != null) {
    superiorSpecialPriceEntity.pageMarginLeft = pageMarginLeft;
  }
  final String? moreShow = jsonConvert.convert<String>(json['more_show']);
  if (moreShow != null) {
    superiorSpecialPriceEntity.moreShow = moreShow;
  }
  final int? bdr = jsonConvert.convert<int>(json['bdr']);
  if (bdr != null) {
    superiorSpecialPriceEntity.bdr = bdr;
  }
  final String? oldpriceColor = jsonConvert.convert<String>(json['oldprice_color']);
  if (oldpriceColor != null) {
    superiorSpecialPriceEntity.oldpriceColor = oldpriceColor;
  }
  final String? bgColor = jsonConvert.convert<String>(json['bg_color']);
  if (bgColor != null) {
    superiorSpecialPriceEntity.bgColor = bgColor;
  }
  final String? showTitle = jsonConvert.convert<String>(json['show_title']);
  if (showTitle != null) {
    superiorSpecialPriceEntity.showTitle = showTitle;
  }
  final String? cornerMarkImage = jsonConvert.convert<String>(json['corner_mark_image']);
  if (cornerMarkImage != null) {
    superiorSpecialPriceEntity.cornerMarkImage = cornerMarkImage;
  }
  return superiorSpecialPriceEntity;
}

Map<String, dynamic> $SuperiorSpecialPriceEntityToJson(SuperiorSpecialPriceEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['countdown_text_color'] = entity.countdownTextColor;
  data['more_btn_style'] = entity.moreBtnStyle;
  data['page_margin_top'] = entity.pageMarginTop;
  data['display_scale'] = entity.displayScale;
  data['image_fill_style'] = entity.imageFillStyle;
  data['mask_color'] = entity.maskColor;
  data['countdown_margin_left'] = entity.countdownMarginLeft;
  data['corner_mark_type'] = entity.cornerMarkType;
  data['text_align_type'] = entity.textAlignType;
  data['show_corner_mark'] = entity.showCornerMark;
  data['bg_image'] = entity.bgImage?.toJson();
  data['uuid'] = entity.uuid;
  data['page_margin_bottom_2'] = entity.pageMarginBottom2;
  data['activity_name_color'] = entity.activityNameColor;
  data['text_style_type'] = entity.textStyleType;
  data['price'] = entity.price;
  data['more_btn_color'] = entity.moreBtnColor;
  data['page_margin_right'] = entity.pageMarginRight;
  data['sub_entry'] = entity.subEntry?.map((v) => v.toJson()).toList();
  data['goods_margin_left_2'] = entity.goodsMarginLeft2;
  data['per'] = entity.per;
  data['bottomrds'] = entity.bottomrds;
  data['goods_margin_iner'] = entity.goodsMarginIner;
  data['page_margin_bottom'] = entity.pageMarginBottom;
  data['countdown_bg_color'] = entity.countdownBgColor;
  data['countdown_margin_top'] = entity.countdownMarginTop;
  data['size_type'] = entity.sizeType;
  data['page_margin_top_2'] = entity.pageMarginTop2;
  data['show_count_down'] = entity.showCountDown;
  data['title_color'] = entity.titleColor;
  data['more_btn_text'] = entity.moreBtnText;
  data['automatic'] = entity.automatic;
  data['countdown_margin_bottom'] = entity.countdownMarginBottom;
  data['price_color'] = entity.priceColor;
  data['border_radius_type'] = entity.borderRadiusType;
  data['goods_margin'] = entity.goodsMargin;
  data['page_margin_left'] = entity.pageMarginLeft;
  data['more_show'] = entity.moreShow;
  data['bdr'] = entity.bdr;
  data['oldprice_color'] = entity.oldpriceColor;
  data['bg_color'] = entity.bgColor;
  data['show_title'] = entity.showTitle;
  data['corner_mark_image'] = entity.cornerMarkImage;
  return data;
}

extension SuperiorSpecialPriceEntityExtension on SuperiorSpecialPriceEntity {
  SuperiorSpecialPriceEntity copyWith({
    String? countdownTextColor,
    int? moreBtnStyle,
    int? pageMarginTop,
    String? displayScale,
    String? imageFillStyle,
    String? maskColor,
    int? countdownMarginLeft,
    String? cornerMarkType,
    String? textAlignType,
    bool? showCornerMark,
    SuperiorSpecialPriceBgImage? bgImage,
    String? uuid,
    int? pageMarginBottom2,
    String? activityNameColor,
    String? textStyleType,
    String? price,
    String? moreBtnColor,
    int? pageMarginRight,
    List<SuperiorSpecialPriceSubEntry>? subEntry,
    int? goodsMarginLeft2,
    int? per,
    bool? bottomrds,
    int? goodsMarginIner,
    int? pageMarginBottom,
    String? countdownBgColor,
    int? countdownMarginTop,
    String? sizeType,
    int? pageMarginTop2,
    String? showCountDown,
    String? titleColor,
    String? moreBtnText,
    String? automatic,
    int? countdownMarginBottom,
    String? priceColor,
    String? borderRadiusType,
    int? goodsMargin,
    int? pageMarginLeft,
    String? moreShow,
    int? bdr,
    String? oldpriceColor,
    String? bgColor,
    String? showTitle,
    String? cornerMarkImage,
  }) {
    return SuperiorSpecialPriceEntity()
      ..countdownTextColor = countdownTextColor ?? this.countdownTextColor
      ..moreBtnStyle = moreBtnStyle ?? this.moreBtnStyle
      ..pageMarginTop = pageMarginTop ?? this.pageMarginTop
      ..displayScale = displayScale ?? this.displayScale
      ..imageFillStyle = imageFillStyle ?? this.imageFillStyle
      ..maskColor = maskColor ?? this.maskColor
      ..countdownMarginLeft = countdownMarginLeft ?? this.countdownMarginLeft
      ..cornerMarkType = cornerMarkType ?? this.cornerMarkType
      ..textAlignType = textAlignType ?? this.textAlignType
      ..showCornerMark = showCornerMark ?? this.showCornerMark
      ..bgImage = bgImage ?? this.bgImage
      ..uuid = uuid ?? this.uuid
      ..pageMarginBottom2 = pageMarginBottom2 ?? this.pageMarginBottom2
      ..activityNameColor = activityNameColor ?? this.activityNameColor
      ..textStyleType = textStyleType ?? this.textStyleType
      ..price = price ?? this.price
      ..moreBtnColor = moreBtnColor ?? this.moreBtnColor
      ..pageMarginRight = pageMarginRight ?? this.pageMarginRight
      ..subEntry = subEntry ?? this.subEntry
      ..goodsMarginLeft2 = goodsMarginLeft2 ?? this.goodsMarginLeft2
      ..per = per ?? this.per
      ..bottomrds = bottomrds ?? this.bottomrds
      ..goodsMarginIner = goodsMarginIner ?? this.goodsMarginIner
      ..pageMarginBottom = pageMarginBottom ?? this.pageMarginBottom
      ..countdownBgColor = countdownBgColor ?? this.countdownBgColor
      ..countdownMarginTop = countdownMarginTop ?? this.countdownMarginTop
      ..sizeType = sizeType ?? this.sizeType
      ..pageMarginTop2 = pageMarginTop2 ?? this.pageMarginTop2
      ..showCountDown = showCountDown ?? this.showCountDown
      ..titleColor = titleColor ?? this.titleColor
      ..moreBtnText = moreBtnText ?? this.moreBtnText
      ..automatic = automatic ?? this.automatic
      ..countdownMarginBottom = countdownMarginBottom ?? this.countdownMarginBottom
      ..priceColor = priceColor ?? this.priceColor
      ..borderRadiusType = borderRadiusType ?? this.borderRadiusType
      ..goodsMargin = goodsMargin ?? this.goodsMargin
      ..pageMarginLeft = pageMarginLeft ?? this.pageMarginLeft
      ..moreShow = moreShow ?? this.moreShow
      ..bdr = bdr ?? this.bdr
      ..oldpriceColor = oldpriceColor ?? this.oldpriceColor
      ..bgColor = bgColor ?? this.bgColor
      ..showTitle = showTitle ?? this.showTitle
      ..cornerMarkImage = cornerMarkImage ?? this.cornerMarkImage;
  }
}

SuperiorSpecialPriceBgImage $SuperiorSpecialPriceBgImageFromJson(Map<String, dynamic> json) {
  final SuperiorSpecialPriceBgImage superiorSpecialPriceBgImage = SuperiorSpecialPriceBgImage();
  final String? attachmentUrl = jsonConvert.convert<String>(json['attachment_url']);
  if (attachmentUrl != null) {
    superiorSpecialPriceBgImage.attachmentUrl = attachmentUrl;
  }
  return superiorSpecialPriceBgImage;
}

Map<String, dynamic> $SuperiorSpecialPriceBgImageToJson(SuperiorSpecialPriceBgImage entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['attachment_url'] = entity.attachmentUrl;
  return data;
}

extension SuperiorSpecialPriceBgImageExtension on SuperiorSpecialPriceBgImage {
  SuperiorSpecialPriceBgImage copyWith({
    String? attachmentUrl,
  }) {
    return SuperiorSpecialPriceBgImage()..attachmentUrl = attachmentUrl ?? this.attachmentUrl;
  }
}

SuperiorSpecialPriceSubEntry $SuperiorSpecialPriceSubEntryFromJson(Map<String, dynamic> json) {
  final SuperiorSpecialPriceSubEntry superiorSpecialPriceSubEntry = SuperiorSpecialPriceSubEntry();
  final int? orderMoney = jsonConvert.convert<int>(json['orderMoney']);
  if (orderMoney != null) {
    superiorSpecialPriceSubEntry.orderMoney = orderMoney;
  }
  final int? pageSize = jsonConvert.convert<int>(json['pageSize']);
  if (pageSize != null) {
    superiorSpecialPriceSubEntry.pageSize = pageSize;
  }
  final int? orderNum = jsonConvert.convert<int>(json['orderNum']);
  if (orderNum != null) {
    superiorSpecialPriceSubEntry.orderNum = orderNum;
  }
  final int? targetType = jsonConvert.convert<int>(json['targetType']);
  if (targetType != null) {
    superiorSpecialPriceSubEntry.targetType = targetType;
  }
  final String? remark = jsonConvert.convert<String>(json['remark']);
  if (remark != null) {
    superiorSpecialPriceSubEntry.remark = remark;
  }
  final String? marketingId = jsonConvert.convert<String>(json['marketingId']);
  if (marketingId != null) {
    superiorSpecialPriceSubEntry.marketingId = marketingId;
  }
  final int? pageNum = jsonConvert.convert<int>(json['pageNum']);
  if (pageNum != null) {
    superiorSpecialPriceSubEntry.pageNum = pageNum;
  }
  final String? sid = jsonConvert.convert<String>(json['sid']);
  if (sid != null) {
    superiorSpecialPriceSubEntry.sid = sid;
  }
  final String? unitType = jsonConvert.convert<String>(json['unitType']);
  if (unitType != null) {
    superiorSpecialPriceSubEntry.unitType = unitType;
  }
  final String? activityId = jsonConvert.convert<String>(json['activityId']);
  if (activityId != null) {
    superiorSpecialPriceSubEntry.activityId = activityId;
  }
  final String? shopNames = jsonConvert.convert<String>(json['shopNames']);
  if (shopNames != null) {
    superiorSpecialPriceSubEntry.shopNames = shopNames;
  }
  final String? activityDate = jsonConvert.convert<String>(json['activityDate']);
  if (activityDate != null) {
    superiorSpecialPriceSubEntry.activityDate = activityDate;
  }
  final int? payNum = jsonConvert.convert<int>(json['payNum']);
  if (payNum != null) {
    superiorSpecialPriceSubEntry.payNum = payNum;
  }
  final String? name = jsonConvert.convert<String>(json['name']);
  if (name != null) {
    superiorSpecialPriceSubEntry.name = name;
  }
  final int? unitTypeValue = jsonConvert.convert<int>(json['unitTypeValue']);
  if (unitTypeValue != null) {
    superiorSpecialPriceSubEntry.unitTypeValue = unitTypeValue;
  }
  final String? activityDiscountId = jsonConvert.convert<String>(json['activityDiscountId']);
  if (activityDiscountId != null) {
    superiorSpecialPriceSubEntry.activityDiscountId = activityDiscountId;
  }
  final String? targetTypeName = jsonConvert.convert<String>(json['targetTypeName']);
  if (targetTypeName != null) {
    superiorSpecialPriceSubEntry.targetTypeName = targetTypeName;
  }
  final String? syncOnline = jsonConvert.convert<String>(json['syncOnline']);
  if (syncOnline != null) {
    superiorSpecialPriceSubEntry.syncOnline = syncOnline;
  }
  final int? status = jsonConvert.convert<int>(json['status']);
  if (status != null) {
    superiorSpecialPriceSubEntry.status = status;
  }
  return superiorSpecialPriceSubEntry;
}

Map<String, dynamic> $SuperiorSpecialPriceSubEntryToJson(SuperiorSpecialPriceSubEntry entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['orderMoney'] = entity.orderMoney;
  data['pageSize'] = entity.pageSize;
  data['orderNum'] = entity.orderNum;
  data['targetType'] = entity.targetType;
  data['remark'] = entity.remark;
  data['marketingId'] = entity.marketingId;
  data['pageNum'] = entity.pageNum;
  data['sid'] = entity.sid;
  data['unitType'] = entity.unitType;
  data['activityId'] = entity.activityId;
  data['shopNames'] = entity.shopNames;
  data['activityDate'] = entity.activityDate;
  data['payNum'] = entity.payNum;
  data['name'] = entity.name;
  data['unitTypeValue'] = entity.unitTypeValue;
  data['activityDiscountId'] = entity.activityDiscountId;
  data['targetTypeName'] = entity.targetTypeName;
  data['syncOnline'] = entity.syncOnline;
  data['status'] = entity.status;
  return data;
}

extension SuperiorSpecialPriceSubEntryExtension on SuperiorSpecialPriceSubEntry {
  SuperiorSpecialPriceSubEntry copyWith({
    int? orderMoney,
    int? pageSize,
    int? orderNum,
    int? targetType,
    String? remark,
    String? marketingId,
    int? pageNum,
    String? sid,
    String? unitType,
    String? activityId,
    String? shopNames,
    String? activityDate,
    int? payNum,
    String? name,
    int? unitTypeValue,
    String? activityDiscountId,
    String? targetTypeName,
    String? syncOnline,
    int? status,
  }) {
    return SuperiorSpecialPriceSubEntry()
      ..orderMoney = orderMoney ?? this.orderMoney
      ..pageSize = pageSize ?? this.pageSize
      ..orderNum = orderNum ?? this.orderNum
      ..targetType = targetType ?? this.targetType
      ..remark = remark ?? this.remark
      ..marketingId = marketingId ?? this.marketingId
      ..pageNum = pageNum ?? this.pageNum
      ..sid = sid ?? this.sid
      ..unitType = unitType ?? this.unitType
      ..activityId = activityId ?? this.activityId
      ..shopNames = shopNames ?? this.shopNames
      ..activityDate = activityDate ?? this.activityDate
      ..payNum = payNum ?? this.payNum
      ..name = name ?? this.name
      ..unitTypeValue = unitTypeValue ?? this.unitTypeValue
      ..activityDiscountId = activityDiscountId ?? this.activityDiscountId
      ..targetTypeName = targetTypeName ?? this.targetTypeName
      ..syncOnline = syncOnline ?? this.syncOnline
      ..status = status ?? this.status;
  }
}
